namespace SimpleWebServices.Models
{
    using System;
    using System.Xml.Serialization;

    [XmlRoot("name")]
    public sealed class PersonalName : ValueObject<PersonalName>
    {
        [XmlAttribute("family")]
        public string Family
        {
            get;
            set;
        }

        [XmlAttribute("given")]
        public string Given
        {
            get;
            set;
        }

        [XmlAttribute("salutation")]
        public string Salutation
        {
            get;
            set;
        }

        public string ToString(IFormatProvider provider)
        {
            return string.Format(
                provider,
                "{0} {1} {2}",
                this.Salutation,
                this.Given,
                this.Family);
        }
    }
}